using System.Runtime.CompilerServices;

namespace Parse.Classes
{
    [IgnoreNamespace]
    public class HtmlEmail
    {
        [AlternateSignature]
        [PreserveName, PreserveCase]
        public static extern string ToEmail(string txt);

        [PreserveName, PreserveCase]
        public static string ToEmail(string txt, ParseXmlOptions options)
        {
            return ParseXml.Transform(txt, new HtmlEmailMap(options));
            //options = options ?? new ParseXmlOptions();
            //ProcessXml r = ProcessXml.Process(txt, new HtmlEmailMap(options));
            //Inform.Debug("Output: {0}", r.output);
            //return r.output;
        }
    }

    [IgnoreNamespace]
    public class HtmlEmailMap : HtmlTransform
    {
        public HtmlEmailMap(ParseXmlOptions options) : base(options)
        {
        }

        public override void Any(ParseXml po)
        {
            //Inform.Debug("Tag: {0}", po.GetTag());
            base.Any(po);
        }

    }
}
/*
namespace Parse
{
    public delegate bool ParseXmlFilterDelegate(ParseXml po, string classNames);

    [Imported]
    [IgnoreNamespace]
    public sealed class ParseXml
    {
        public string GetTag()
        {
            return null;
        }

        [PreserveName, PreserveCase]
        public static string Transform(string txt, HtmlTransform map)
        {
            return null;
        }
    }

    [IgnoreNamespace]
    [Imported]
    public sealed class ParseXmlOptions
    {
        public Dictionary controller;
        public bool usecase;
        public bool lonely;
        [PreserveName, PreserveCase]
        public ParseXmlFilterDelegate Filter;
    }

    [Imported]
    public class HtmlTransform : XmlMap
    {
        public HtmlTransform(ParseXmlOptions options)
        {
        }

    }

    [Imported]
    public class XmlMap
    {
        public int level;
        public ParseXmlOptions options;

        /// <summary>
        /// Executed for any tag not explicitly defined.
        /// Ignores script, style, xmp, ?, and ! tags
        /// ... add explicit definitions to include them
        /// </summary>
        /// <param name="po">The po.</param>
        [PreserveName]
        public virtual void Any(ParseXml po)
        {
        }

        /// <summary>
        /// Executed for any remaining area after a tag.
        /// </summary>
        /// <param name="po">The parse object</param>
        [PreserveName]
        public virtual void Area(ParseXml po)
        {
        }
    }
}
 */
